﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PClusterModel.Comparer
{
    public class MicroarrayDataObjectEqualityComparer: IEqualityComparer<IMicroarrayDataObject>
    {
        #region IEqualityComparer<IMicroarrayDataObject> Members

        public bool Equals(IMicroarrayDataObject x, IMicroarrayDataObject y)
        {
            if (x != null && y != null)
            {
                return x.Name == y.Name;
            }
            else if (x == null && y == null)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public int GetHashCode(IMicroarrayDataObject obj)
        {
            return obj.Name.GetHashCode();
        }

        #endregion
    }
}
